package com.an_yang_gang_yie.an_yang_gang_yie.system.controller;


import com.an_yang_gang_yie.an_yang_gang_yie.annotation.UserLoginToken;
import com.an_yang_gang_yie.an_yang_gang_yie.entity.AjaxResponseBody;
import com.an_yang_gang_yie.an_yang_gang_yie.enum_util.ResponseBodyEnum;
import com.an_yang_gang_yie.an_yang_gang_yie.system.entity.AdminUser;
import com.an_yang_gang_yie.an_yang_gang_yie.system.mapper.AdminUserMapper;
import com.an_yang_gang_yie.an_yang_gang_yie.utils.Utils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.runtime.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/adminUser/admin-user")
@CrossOrigin
@Api(value = "管理员账户",tags = {"管理员账户"})
public class AdminUserController {
    /**
     *
     */
    @Autowired
    private AdminUserMapper adminUserMapper;
    @GetMapping("/all")
    @ResponseBody
    @ApiOperation("获取全部管理员账户")
    public AjaxResponseBody getAdminUserList(HttpServletRequest request){

        List<AdminUser> adminUsers = adminUserMapper.selectList(null);
        String ip = Utils.getIp(request);
        System.out.println(ip);
        return new AjaxResponseBody(ResponseBodyEnum.RESPONSE_BODY_ENUM_OK,adminUsers);
    }
}
